package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import view.NewWorkoutPlan2;
import view.templates.MyJButton;

public class NewWorkoutPlanListener2 implements ActionListener {

	private Controller controller;
	private NewWorkoutPlan2 newWorkoutPlan;

	public NewWorkoutPlanListener2(Controller controller) {
		this.controller = controller;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		newWorkoutPlan = controller.getFrame().getNewWorkoutPlan2();

		if (e.getSource().getClass() == MyJButton.class) {
			MyJButton b = (MyJButton) e.getSource();
			if (b == newWorkoutPlan.getNextButton()) {
				controller.getFrame().initNewWorkoutScreen3();
			} else if (b == newWorkoutPlan.getReturnButton()) {
				controller.getFrame().initNewWorkoutScreen1();
			}
		}
	}
}
